﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using Microsoft.Xna.Framework.Net;
using Microsoft.Xna.Framework.Storage;
using SpriteSheetRuntime;

namespace Megaman
{
    class Animation 
    {
       
        public SpriteSheet spriteSheet;
        public int startingFrame;
        public int frameCount;
        public Vector2 frameDimensions;
        public int fps;
        public bool isLooping;
        public Rectangle localBounds;
        public Vector2 Origin;

        public Animation(SpriteSheet spriteSheet, String startingSprite,
            int frameCount, Vector2 Dimensions, int fps, bool loop, Rectangle localBounds,Vector2 Origin)
        {
            this.spriteSheet = spriteSheet;
            this.startingFrame = this.spriteSheet.GetIndex(startingSprite);
            this.frameCount = frameCount;
            this.frameDimensions = Dimensions;
            this.fps = fps;
            this.isLooping = loop;
            this.localBounds = localBounds;
            this.Origin = Origin;
        }


        public Rectangle SourceRectangle(int frame)
        {
            return spriteSheet.SourceRectangle(frame);
        }

        public Texture2D getTexture()
        {
            return spriteSheet.Texture;
        }
    }
}
